
<template>
	<!-- 添加弹框 -->
	<el-dialog title="" size='tiny' :visible.sync="dialogTableVisible" class="wrap" @close="cancel" :close-on-click-modal="false">
		<i class="el-icon-close close" @click="cancel" style="color: white;z-index: 99;"></i>
	    <div class="bt">审批</div>
	       <el-form label-width="100px" class="form">
					 <el-form-item label="审批">
		 					<el-select v-model="check" placeholder="请选择" class="select-block">
		 						<el-option label="待审核" value="0"></el-option>
		 						<el-option label="通过" value="1"></el-option>
		 						<el-option label="不通过" value="2"></el-option>
		 					</el-select>
		 			</el-form-item>
		</el-form>
		<el-button type="info" class="submit" @click="submit">保存</el-button>
	</el-dialog>
</template>
<script type="text/javascript">
	import qs from 'qs'
	export default {
		props: ['params'],
		data() {
			return {
				form: {
					id: ''
				},
				check:'0',
				dialogTableVisible: true
			}
		},
		created() {
           this.form.id=this.params.row.id;
		},
		methods: {
			submit() {
				//检测
				this.$store.state.loading = true;

				var logininfo = JSON.parse(localStorage.logininfo);
				var params3 = qs.stringify({
					id:this.form.id,
					spjg:this.check,
					yhid: logininfo.id,
					xxid:logininfo.xxid
				});
				//执行
				this.axios.post(this.$store.state.api + 'lsqj/check', params3)
					.then(res => {
						if(res.data.code == 1) {
							this.$emit('close', { type: 'shenpi', cancel: false });
							this.$store.state.loading = false;
						} else {
							this.$emit('close', { type: 'shenpi', cancel: false });
							this.$store.state.loading = false;
						}
					}).catch(res => {
						this.$message.warning("服务器繁忙，请重试");
						//this.$emit('close', { type: 'add', cancel: false });
						this.$store.state.loading = false;
					})
			},
			cancel() {
				this.$emit('close', { type: 'shenpi', cancel: true })
			}
		}
	}
</script>
<style lang="less" scoped>
	.wrap {
		.input-block {
			margin-bottom: 20px;
			text-align: center;
		}
		.bt{
		position: absolute;
			width: 100%;
			height: 50px;
			margin: 0 auto;
			top:0;
			left:0;
			background: #50BFFF;
			margin-bottom: 20px;
			color:white;
			text-align:left;
			line-height: 50px;
			font-size: 17px;
			padding-left: 15px;
		}
		.input {
			display: inline-block;
		}
		.select-block {
	 		display: block;
	 		width: 85%;
 	    }
 	    .form {
		text-align: center;
	}
		.submit {
			width: 120px;
			display: block;
			margin: 0 auto;
			margin-top: 20px;
		}
	}
</style>
